﻿
<%


set conn=server.createobject("adodb.connection")
connstr="Driver={SQL Server};SERVER=N-SERVER\MSSQLSERVER2;UID=sa;Password=jckj2008;DATABASE=UnexDB2"
conn.open connstr
%>

<HTML>
<HEAD>
<TITLE></TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link href="../css/StyleSheet.css" rel="stylesheet" type="text/css">


<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</HEAD>
<BODY BGCOLOR="WHITE" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">


<table width="750" border="0" cellspacing="0" cellpadding="1" align="left">

	
  <tr>   
  <td valign=top height=58 align=center>


        <form name="form1" method="post" action="truckcheck.asp">
          <table width="99%" border="1" cellspacing="0" cellpadding="0">
            <tr> 
              <td align="right" bgcolor="#efefef">&#26085;&#26399;:&nbsp;</td>
			  <td align="left">&nbsp;
			  <input name="startDate" type="text" value="" size="30" maxlength="30">
			  &#26684;&#24335;(8/12/2011)</td>
              <td align="right" bgcolor="#efefef">&#24080;&#21495;:&nbsp;</td>
			  <td align="left">&nbsp;
			  <input name="SNID" type="text" size="10" maxlength="10">
			  </td>	
   			  <td rowspan="2" align="center"><input type="submit" name="Submit" value="Search"></td>				
		    </tr>
			  <tr>
              <td align="right" bgcolor="#efefef">&nbsp;</td>
			  <td align="left">&nbsp;</td>			  
              <td align="right" bgcolor="#efefef">&nbsp;</td>
			  <td align="left">&nbsp;</td>	
             </tr>
          </table>
        </form>
	</td>
  </tr>
              
	  <tr>
     	<td colspan="4">
      	<TABLE width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
		<%
		%>            
        <tr bgcolor="#969ac2">
          <td  height="21" colspan="7" align="center"><span class="style1">&#22823;&#36135;&#23548;&#20837;&#25253;&#34920;</span></td>
          </tr>
        <tr bgcolor="#969ac2"> 
          <td width="6%"  height="21" align="center"><font color="#FFFFFF">&#24080;&#21495;</font></td>
          <td width="10%"  align="center"><span class="style1">&#25968;&#37327;</span></td>
          <td width="10%"  align="center"><font color="#FFFFFF">&#26085;&#26399;</font></td>
          <td width="8%"><div align="center"><font color="#FFFFFF">&#21697;&#21517;</font></div></td>
          <td width="4%" align="center">&nbsp;</td>
          <td width="2%" align="center">&nbsp;</td>
          <td width="2%" align="center">&nbsp;</td>
        </tr>
<%
	maxmessage=15
	PageNo = request("PageNo")
	if PageNo = "" or CInt(PageNo) < 1 then PageNo = 1
	
	
	if request("Submit")="Search"  or request("id")<>"" then 
		
		strSQL=" SELECT top 10000 * from truckShip where 1=1"

			if request("startDate")<>"" then
				strSQL=strSQL & " and  date='"&request("startDate")&"'"
			end if
			
			if request("SNID")<>"" then
				strSQL=strSQL & " and  AccountNo='"&request("SNID")&"'"
			end if

			if request("id")<>"" then
				strSQL=strSQL & " and  id='"&request("id")&"'"
			end if


		strSQL=strSQL & " Order by id desc"
		set rs=server.CreateObject("adodb.recordset")
		rs.open strSQL,connstr,1,1
		if not rs.eof then
		
		rs.pagesize=maxmessage
		PageCount = rs.PageCount

		if CInt(PageNo) > PageCount then PageNo = PageCount
			rs.absolutepage = PageNo
			Rec_Total=rs.RecordCount
			n=0
			while not rs.eof and n < rs.pagesize
			n=n+1	

	%>
        <tr align="center" bgcolor="#efefef"> 
          <td><%=rs("AccountNo")%></td>
          <td><%=rs("shuliang")%> </td>
          <td><%=rs("date")%> </td>
		  

          <td><%=rs("name")%></td>
          <td> <a href="Edit3.asp?id=<%=rs("id")%>&AccountNo=<%=rs("AccountNo")%>">Edit</a> </td>
          <td> <a href="addintruck.asp">add</a> </td>
          <td><a href="deltruckship.asp?id=<%=rs("id")%>">delete</a></td>
        </tr>
    <%
	rs.movenext
	wend
	%>
        <tr> 
          <td colspan=7> <div align="center">Page <%=PageNo%> of <%=PageCount%>&nbsp;&nbsp;Current Page:
              <%
		for i=1 to PageCount
			if cint(PageNo)=cint(i) then
				response.write "&nbsp;&nbsp;<b>"&i&"</b>"
			else
		%>
                 &nbsp;&nbsp; <a href="truckheck.asp?submit=Search&PageNo=<%=i%>&PT=<%=request("PT")%>&startdate=<%=request("startdate")%>&snid=<%=request("snid")%>"><%=i%></a>  
              <%
			end if
		next
 end if
 rs.close
 end if %>
            
			</td>
        </tr>
      </TABLE>
	</td>			
  </tr>

  <tr>

  </tr> 

</table>

</BODY>
</HTML>